
import org.molamil.acto.props.TypeParser;
import asunit.framework.TestCase;

class org.molamil.acto.props.TypeParserTest extends TestCase {
	
	
	private var className:String = "org.molamil.acto.props.TypeParserTest";
	private var instance:TypeParser;

	
	public function setUp():Void {
		instance = new TypeParser();
	}

	public function tearDown():Void {
		delete instance;
	}

	public function testInstantiated():Void {
		assertTrue("TypeParser instantiated", instance instanceof TypeParser);
	}
	
	public function testParse() {
		//TODO: Implement.
	}
	
	public function testParseNumber() {
		//TODO: Implement.
	}
	
	public function testParseBoolean() {
		//TODO: Implement.
	}
	
	public function testParseDate() {
		//TODO: Implement.
	}
	
	public function testIsNull() {
		assertTrue("\"\"(empty string)", TypeParser.isNull(""));
		assertFalse("\" \"(one space string)", TypeParser.isNull(" "));
		assertTrue("null", TypeParser.isNull(null));		assertTrue("undefined", TypeParser.isNull(undefined));		assertFalse("\"Jorge\"", TypeParser.isNull("Jorge"));		assertFalse("\"0\"", TypeParser.isNull("0"));		assertFalse("\"false\"", TypeParser.isNull("false"));
	}
	
	public function testIsNumber() {
		assertFalse("\"\"(empty string)", TypeParser.isNumber(""));
		assertFalse("\" \"(one space string)", TypeParser.isNumber(" "));
		assertFalse("null", TypeParser.isNumber(null));
		assertFalse("undefined", TypeParser.isNumber(undefined));
		assertFalse("\"false\"", TypeParser.isNumber("false"));
		assertTrue("\"0\"", TypeParser.isNumber("0"));		assertTrue("\"1233213432654670\"", TypeParser.isNumber("1233213432654670"));		assertFalse("\"0,5\"", TypeParser.isNumber("0,5"));		assertTrue("\"0.5\"", TypeParser.isNumber("0.5"));		assertFalse("\"false\"", TypeParser.isNumber("false"));		assertFalse("\"Jorge\"", TypeParser.isNumber("jorge"));		assertFalse("\"1f\"", TypeParser.isNumber("1f"));		assertFalse("\"d876\"", TypeParser.isNumber("d876"));		assertTrue("\"0x123\"", TypeParser.isNumber("0x123"));		assertTrue("\"0X123\"", TypeParser.isNumber("0X123"));		assertTrue("\"0xFFFFDD\"", TypeParser.isNumber("0xFFFFDD"));		assertTrue("\"0xC\"", TypeParser.isNumber("0xC"));		assertFalse("\"0x\"", TypeParser.isNumber("0x"));		assertFalse("\"0xGG\"", TypeParser.isNumber("0xGG"));		assertFalse("\"x123\"", TypeParser.isNumber("x123"));		assertFalse("\"00x123\"", TypeParser.isNumber("00x123"));		assertFalse("\"1x123\"", TypeParser.isNumber("1x123"));		assertFalse("\"0x123x\"", TypeParser.isNumber("0x123x"));		assertFalse("\"0xx1\"", TypeParser.isNumber("0xx1"));		assertTrue("\"00123\"", TypeParser.isNumber("00123"));		assertTrue("\"0e11\"", TypeParser.isNumber("0e11"));		assertTrue("\"0E11\"", TypeParser.isNumber("0E11"));		assertTrue("\"10.5E11\"", TypeParser.isNumber("10.5E11"));		assertFalse("\"10.5E11e\"", TypeParser.isNumber("10.5E11e"));		assertFalse("\"10.5E11e11\"", TypeParser.isNumber("10.5E11e11"));		assertFalse("\"10.5E\"", TypeParser.isNumber("10.5E"));
	}
	
	public function testIsDate() {
		//TODO: Implement.
	}


}
